import request from '@/utils/request'

// 查询培训考试题目列表
export function listTopic(query) {
  return request({
    url: '/demo/topic/list',
    method: 'get',
    params: query
  })
}


export function listTopicForTask(query) {
  return request({
    url: '/demo/topic/getInfo',
    method: 'get',
    params: query
  })
}

// 查询培训考试题目详细
export function getTopic(id) {
  return request({
    url: '/demo/topic/' + id,
    method: 'get'
  })
}

// 新增培训考试题目
export function addTopic(data) {
  return request({
    url: '/demo/topic',
    method: 'post',
    data: data
  })
}

// 修改培训考试题目
export function updateTopic(data) {
  return request({
    url: '/demo/topic',
    method: 'put',
    data: data
  })
}

// 删除培训考试题目
export function delTopic(id) {
  return request({
    url: '/demo/topic/' + id,
    method: 'delete'
  })
}

export function saveUserAnswer(data) {
  return request({
    url: '/demo/topic/saveUserAnswer',
    method: 'post',
    data: data
  })
}
